package com.tbs.easyhomemoneyserver.dao

import com.tbs.easyhomemoneyserver.DO.NodeEditor
import com.tbs.easyhomemoneyserver.model.dto.FlowNodeDTO
import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Select
import tk.mybatis.mapper.common.BaseMapper

@Mapper
interface NodeEditorMapper : BaseMapper<NodeEditor> {
    @Select(
        FlowNodeDTO.BASIC_SQL + "\tWHERE (SELECT ne.id FROM node_editor ne WHERE" +
                " ne.user_id=#{arg0} " +
                "and ne.node_id=fn.id limit 1)" +
                " is not NULL"
    )
    fun findNodeByNodeEditorId(id: Long): List<FlowNodeDTO>
}
